<template>
    <div class="app-container">
        <div class="btnList">
            <el-button type="primary" @click="addStandar()" class="addStyle">新建</el-button>
            <el-button>批量删除</el-button>
            <el-button>导出</el-button>
        </div>
        <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" max-height="680"
            class="TableStyle">
            <el-table-column show-overflow-tooltip type="selection" width="100" align="center" />
            <el-table-column show-overflow-tooltip label="名称" prop="serviceName"  >
                <template slot-scope="scope">
                    <span type="text" @click="impactAnalysis" style="
                                color: #7483a6;
                                font-size: 16px;
                                font-weight: 500;
                                cursor: pointer;
                                marginleft: 20px;
                              ">{{scope.row.serviceName}}</span>
                </template>
            </el-table-column>
            <el-table-column show-overflow-tooltip label="分析类型" prop="typeId" />

            <el-table-column show-overflow-tooltip label="创建人" prop="authorName" />
            <!-- <el-table-column show-overflow-tooltip label="维护时间"  prop="createTime" /> -->
            <el-table-column prop="createTime" label="创建时间" width="160">
                <template slot-scope="scope">
                    <span>{{ formatTime(scope.row.createTime) }}</span>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="250">
                <template slot-scope="scope">
                    <!-- 数据权限 -->
                    <el-tooltip class="item" effect="dark" content="重新命名" placement="top">
                        <el-button type="text" class="nolockColor">
                            <!-- <span class="iconfont look">&#xe66b;</span> -->
                            重新命名
                        </el-button>
                    </el-tooltip>
                    <!-- 删除 -->
                    <el-tooltip class="item" effect="dark" content="删除" placement="top">
                        <el-button type="text" class="nolockColor" v-if="scope.row.useStatus == 0"
                            @click="handleDelete(scope.row)">
                            删除
                            <!-- 删除 -->
                            <!-- <span class="iconfont">&#xe74e;</span> -->
                        </el-button>
                    </el-tooltip>
                </template>
            </el-table-column>
        </el-table>
        <div class="paginationBigbox">
            <div class="paginationbox">
                <el-pagination @size-change="handleSizeChange" :current-page.sync="queryParams.current"
                    @current-change="handleCurrentChange" :page-size="queryParams.size" layout="total,prev, pager, next"
                    background :total="pageTotal" ref="pagination">
                </el-pagination>
            </div>
        </div>
    </div>
</template>
<script>
import moment from "moment";
export default {
    name: "myAnalysis",
    components: {
    },
    data() {
        return {
            // 总条数
            pageTotal: 12,
            //批量删除的状态
            disabledInfo: true,
            // 遮罩层
            loading: false,
            //搜索条件
            queryParams: {
                catalogueId: "", // 标准集id
                standardId: "", //标准编号
                standardChName: "", //标准中文名
                standardName: "", //标准英文名
                page: 1,
                size: 10,
            },
            //table的数据
            postList: [
                {
                    serviceName: '角色名称1',
                    typeId: '普通角色',
                    useStatus: 0,
                    createTime: '2021-09-14     10:00:00',
                    authorName: 'admin'
                },
                {
                    serviceName: '角色名称1',
                    typeId: '普通角色',
                    useStatus: 0,
                    createTime: '2021-09-14     10:00:00',
                    authorName: 'admin'
                },
            ],
            //批量删除中选中的项list
            selection: [],
            //数据权限的表单
            ruleForm: {},
            //传送的数据
            dataObj: {},
            rules: {
                region: [
                    { required: true, message: '请选择权限范围', trigger: 'change' }
                ],
            }
        };
    },
    mounted() {

    },
    methods: {
        //影响分析
        impactAnalysis() {
            this.$router.push({
                path: "/Metadata/impactAnalysis",
                // query: { id: "1", name: "元数据", status: "2" },
            });
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.selection = selection;
            if (selection.length > 1) {
                this.disabledInfo = false;
            }
        },
        //删除
        handleDelete() {
            this.$modal.confirm("是否永久删除？删除后将无法恢复").then(() => {

            });
        },
        //处理时间
        // 时间格式化
        formatTime(time) {
            // return utils.rTime(time);
            return moment(time).format("YYYY-MM-DD HH:mm:ss");
        },
        handleSizeChange(val) {
            this.queryParams.size = val;
        },
        handleCurrentChange(val) {
            this.queryParams.current = val;
        },
        //点击关闭的时候
        handleClose(done) {
            this.$confirm("确认关闭？")
                .then(_ => {
                    done();
                })
                .catch(_ => { });
        },
        //操作权限关闭弹框
        closeopenAuthorization() {
            this.operatingAuthorizationBloon = false;
        },
        //新建
        addStandar() {

        },
    }
};
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/mixin.scss";
@import "~@/assets/styles/variables.scss";
@import "~@/assets/styles/CommonStyle.scss";

.btnList {
    padding-top: 40px !important;

}
</style>
  